import { createStore } from 'vuex'
import createPersistedstate from 'vuex-persistedstate'
import moduleA from './modules/moduleA'
import { State } from './store.d'
const store = createStore({
    plugins: [
        createPersistedstate({
            key: 'vuex',
            storage: window.localStorage
        })
    ],
    state: {
        hahaha: 1234
    },
    getters: {},
    mutations: {
        SET_HAHAHA(state: State, params: Number) {
            state.hahaha = params
        }
    },
    actions: {
        setHahaha: ({ commit }: any, params: Number) => {
            commit('SET_HAHAHA', params)
        }
    },
    modules: {
        moduleA
    },
})
export default store